package com.commons.web.controller;


import cn.hutool.db.meta.*;
import com.mysql.cj.x.protobuf.*;
import io.swagger.annotations.*;
import org.springframework.web.bind.annotation.*;

/**
 * 数据表及字段修改,ddl操作
 */
@Api(tags = "DB Manage Controller")
@RestController
@RequestMapping("/db")
public class TableOrFieldsController {

    @ApiOperation("创建数据表")
    @PostMapping
    public void create() {

    }

    @ApiOperation("删除数据表")
    @DeleteMapping("{tableName}")
    public void delete(@PathVariable String tableName) {

    }

    @ApiOperation("更新数据表结构")
    @PutMapping("{tableName}/structure/{newTableName}/{oldTableName}")
    public void updateStructure(@PathVariable String newTableName,@PathVariable String oldTableName ) {

    }

    @ApiOperation("更新数据表字段名")
    @PutMapping("{tableName}/fieldName/updateName/{columnName}/{newColumnName}")
    public void updateFieldName(@PathVariable String columnName,@PathVariable String newColumnName) {

    }

    @ApiOperation("增加数据表字段")
    @PutMapping("{tableName}/fieldAdd/{columnInfo}")
    public void addField(@RequestBody Column columnInfo){

    }


    @ApiOperation("删除数据表字段")
    @DeleteMapping("{tableName}/fieldDelete/{columnName}")
    public void delFiled(){

    }

    @ApiOperation("修改数据表字段类型")
    @PutMapping("{tableName}/fieldType/updateType/{columnName}/{newColumnType}")
    public void updataFieldType (@PathVariable  String columnName,@PathVariable int   newColumnType ){

    }


}
